# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: Simon Rupf <simon@rupf.net>
pkgname=man-db
pkgver=2.13.0
pkgrel=0
pkgdesc="The man command and related utilities for examining on-line help files"
url="https://man-db.gitlab.io/man-db/"
arch="all"
license="GPL-2.0-or-later"
depends="groff less"
makedepends="gdbm-dev gettext-dev libpipeline-dev zlib-dev libseccomp-dev"
subpackages="$pkgname-lang $pkgname-doc"
source="https://download.savannah.nongnu.org/releases/man-db/man-db-$pkgver.tar.xz
	ignore.patch
	"
install="$pkgname.pre-install $pkgname.pre-upgrade"
triggers="man-db.trigger=/usr/share/man"

# allow main/mandoc to provide this first
provides="doc-provider"
provider_priority=10

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-setuid \
		--with-sections="1 1p 1x 2 2x 3 3p 3const 3head 3type 3x 4 4x 5 5x 6 6x 7 7x 8 8x 9 0p tcl n l p o" \
		--enable-nls \
		--with-db=gdbm \
		--with-systemdsystemunitdir=no \
		--with-systemdtmpfilesdir=no \
		--with-libseccomp
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
612ce39bb1e11aa7797e8e3a26f06a7154c48a13b2d74217c2c6701e0d33fa8f77ae2b8c9ee84353e364d16918f884115f2dfbf3cd743edd4ed32b763b87f723  man-db-2.13.0.tar.xz
839b03170f7810956a5769b0df732bed82058e92c879ba3fb5aae579d05b66b973da917690bb3d1c648ebf6f4c35f035214886c9345ea4d5f1bae48e1bca4402  ignore.patch
"
